<template>
<!--    <h1>轮播图组件</h1>-->
    <el-carousel indicator-position="outside" height="400px">
      <el-carousel-item v-for="(value,index) in banner_list" :key="index">
        <a :href="value.link" target="_blank">
          <img :src="value.image_url" alt="" style="width: 100%;height: 400px">
        </a>
      </el-carousel-item>
    </el-carousel>


</template>

<script>
    //router-link主要用于站内页面跳转，使用的是相对路径
    //a标签用于外部链接页面跳转

    export default {
        name: "Banner",
      data(){
          return {
            banner_list:[],
          }
      },
      created(){
          this.$axios.get(`${this.$settings.host}/home/banner/`)
        .then((res)=>{
          this.banner_list = res.data;
        })
        .catch((error)=>{
        })
      },
    }
</script>

<style scoped>

</style>
